package cn.yzgy.yzgyoa.ucenter.service.impl;

import cn.yzgy.yzgyoa.ucenter.entity.SysRolePermission;
import cn.yzgy.yzgyoa.ucenter.mapper.SysRolePermissionMapper;
import cn.yzgy.yzgyoa.ucenter.service.ISysRolePermissionService;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色-权限表 服务实现类
 * </p>
 *
 * @author Yqsen
 * @since 2019-12-10
 */
@Service
public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionMapper, SysRolePermission> implements ISysRolePermissionService {

    @Override
    public int addSysRolePermission(SysRolePermission sysRolePermission) {
        return baseMapper.insert(sysRolePermission);
    }

    @Override
    public int delSysRolePermission(List<String> roleId) {
        UpdateWrapper<SysRolePermission> wrapper=new UpdateWrapper<>();
        wrapper.in(true,"r_id",roleId);
        return baseMapper.delete(wrapper);
    }
}
